package ru.nnstu.client;

import org.apache.log4j.Logger;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import ru.nnstu.client.gui.ClientViewer;
import ru.nnstu.server.PlayerService;

public class ClientLauncher {

	/**
	 * @param args
	 * @throws InterruptedException
	 * @throws Exception
	 */
	private final static Logger LOG = Logger.getLogger(ClientLauncher.class);
	private static PlayerService playerService = null;

	public static PlayerService getPlayerservice() {
		return playerService;
	}

	public static void main(String[] args) throws InterruptedException,
			Exception {
		// Creating ClientForm = new Creating();
		// ClientForm.setVisible(true);

		final ApplicationContext ctxCli = new ClassPathXmlApplicationContext(
				new String[] { "classpath:ru/nnstu/client/clientContext.xml",
						"classpath:ru/nnstu/client/clientJmsContext.xml" });
		playerService = (PlayerService) ctxCli.getBean("PlayerService");
		ClientViewer.main(args);
		playerService.createPlayer("Ilya", "male");
		


	}
}
